package com.example.demo.chat;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.Getter;

@AllArgsConstructor
@Getter
public enum MessageType {
    PRIVATE(1),
    GROUP(2),
    ERROR(3);
    private Integer type;
    public static MessageType match(Integer type){
        for (MessageType value : MessageType.values()) {
            if (value.getType().equals(type)){
                return value;
            }
        }
        return ERROR;
    }
}
